package com.erp.framework.domain;

import com.erp.framework.annotation.Excel;
import com.erp.framework.constant.Constants;
import com.erp.framework.core.domain.BaseEntity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 角色表 sys_role
 *
 * @author erp
 */
public class SysRole extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 角色名称
     */
    @Excel(name = "角色名称")
    private String name;

    /**
     * 角色权限
     */
    @Excel(name = "角色权限")
    private String code;

    /**
     * 用户是否存在此角色标识 默认不存在
     */
    @Excel(name = "用户是否存在此角色标识")
    private boolean flag = false;

    /**
     * 菜单组
     */
    private String[] menuIds;

    public SysRole() {

    }

    public SysRole(String roleId) {
        this.setId(roleId);
    }


    @NotBlank(message = "角色名称不能为空")
    @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @NotBlank(message = "角色编码不能为空")
    @Size(min = 0, max = 100, message = "角色编码长度不能超过100个字符")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public String[] getMenuIds() {
        return menuIds;
    }

    public void setMenuIds(String[] menuIds) {
        this.menuIds = menuIds;
    }

}
